<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>问答分类</title>
<link href="./public/core/admin/css/base.css" rel="stylesheet" type="text/css" />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<script src="./public/core/admin/js/ask_admin.js"  type="text/javascript"></script>
<script language="javascript" src="./public/core/index/js/dedeajax2.js"></script>

<style type="text/css">
<!--
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
.at_piut2 { border:1px solid #66ACDF;height:2px;}
-->
</style>
<script  language="javascript">
	function docChange(sel){	
		document.getElementById("doc").src=sel.title;	
	}	
	function getdoc()
	{	
		var tid=$DE('ClassLevel1').value;
		var tid2=$DE('ClassLevel2').value;
		if(tid=="") return;
		var obj=$DE('docphoto');
		var myajax = new DedeAjax(obj);
		myajax.AddKey('action','ajax');
		myajax.AddKey('tid',tid);
		myajax.AddKey('tid2',tid2);
		<?php if($askanswer){?>var did=$DE('did').value;myajax.AddKey('did',did);<?php }?>
		myajax.SendPost('?do=ask_answer_me');
	}
</script>
</head>
<body background='img/allbg.gif' leftmargin='8' topmargin='8'>
<div class="bodytitle" align="center">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt" ><a href='../ask' target='_blank'><b>问答模块</b></a> -- 快速问答</div>
</div>

<form name="ask" action="" method="post">
	<input type="hidden" name="action" value="<?php if($id){ echo 'edit';}else{ echo 'add';}?>" />
	<?php if($askanswer)?><input type="hidden" id="did" name="did" value="<?php echo $askanswer['doctorid']?>" /><?php ?>
	<table width="600px" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;margin-bottom:6px;">
        <tr height="130px">
            <td align="center" bgcolor="#FFFFFF">问题分类</td>
            <td align="center" bgcolor="#FFFFFF" >
                <div class="postbox">
                  <DL>
                      <DD>
                        <SELECT style="WIDTH: 160px" id="ClassLevel1" size="3" name="ClassLevel1" class="at_piut2"></SELECT> 
                        <STRONG class="jiantou">→</STRONG> 
                        <SELECT style="WIDTH:120px" id="ClassLevel2" size="3" name="ClassLevel2" class="at_piut2"></SELECT>
                      </DD>
                  </DL>
                </div>
                <div class=floatclear><!--清除浮动--></div><!--页面底部-->
            </td>
        </tr>
        <tr bgcolor="#EDF9D5">
            <td width="100px" height="20" align="center" bgcolor="#FFFFFF">问答标题：</td>
            <td width="500px" bgcolor="#FFFFFF"><input  type="text" name="title"  style="width:300px"  value="<?php echo $askquestion['title']?>"/></td>
        </tr>
        <tr>
            <td height="40" align="center" bgcolor="#FFFFFF" style="writing-mode: tb-rl">问 题 内 容</td>
            <td bgcolor="#FFFFFF">
            <textarea  name="content"  cols="80" rows="10" style="width:500px; height:100px; font-size:13px;" onpropertychange="TextUtil.NotMax(this)" maxlength="1100"><?php echo $askquestion['content']?></textarea> 
            </td>
        </tr>
        <tr>
            <td height="90" align="center" bgcolor="#FFFFFF" style="writing-mode: tb-rl">显示医生</td>
            <td bgcolor="#FFFFFF">
                <div name="docphoto" id="docphoto">
			</div>
            </td>
        </tr>
        <tr>
            <td height="35" align="center" bgcolor="#FFFFFF" style="writing-mode: tb-rl">专 家 回 答</td>
            <td bgcolor="#FFFFFF"><textarea   name="answeraa" cols="80" rows="10" style="width:500px; height:150px; font-size:13px; " onpropertychange="TextUtil.NotMax(this)" maxlength="1200"><?php echo $askanswer['content'];?></textarea></td>
        </tr>
        <tr bgcolor="#EDF9D5">
            <td width="100px" height="20" align="center" bgcolor="#FFFFFF">引用：</td>
            <td width="500px" bgcolor="#FFFFFF"><input  type="text" name="brief"  style="width:300px"  value="<?php echo $askanswer['brief'];?>"/></td>
        </tr>
        <tr align="center"><td colspan="2">
            <select name="kind">
                <option value="1"  <?php if($k['kind']==1) echo 'selected';?>>已解决</option>
                <option value="2"  <?php if($k['kind']==2) echo 'selected';?>>精彩</option>
                <option value="3"  <?php if($k['kind']==3) echo 'selected';?>>推荐</option>
            </select>&nbsp;&nbsp;
            <input type="submit" value="回复" />&nbsp;&nbsp;
            <input type="button" value="取消" onclick="window.location.href='?do=ask_admin'"/>
        </td></tr>
    </table>
</form>
<SCRIPT language=javascript>
	var g_ClassLevel1;
	var g_ClassLevel2;
	
	<?php
	echo $tids."\n".$tid2s;
	?>
	
	function FillClassLevel1(ClassLevel1)
	{
		for(i=0; i<class_level_1.length; i++) {
			ClassLevel1.options[i] = new Option(class_level_1[i][1], class_level_1[i][0]);	
			<?php if($id){?>if (class_level_1[i][0] == <?php echo $askquestion[tid];?>) {ClassLevel1.options[i].selected =true;}<?php }?>
		}
		<?php if(!$id){?>ClassLevel1.options[0].selected = true;<?php }?>
		ClassLevel1.length = i;
	}
	
	function FillClassLevel2(ClassLevel2, class_level_1_id)
	{
		ClassLevel2.options[0] = new Option("不选", "");
		 count = 1;
		for(i=0; i<class_level_2.length; i++) {
			if(class_level_2[i][0].toString() == class_level_1_id) {
				ClassLevel2.options[count] = new Option(class_level_2[i][2], class_level_2[i][1]);
				<?php if($id){?>if (class_level_2[i][1] == <?php echo $askquestion[tid2];?>) { ClassLevel2.options[count].selected =true;}<?php }?>
				count = count+1;
			}
		}
		
		<?php if(!$id){?>ClassLevel2.options[0].selected = true;<?php }?>
		ClassLevel2.length = count;
		
	//	docphoto.option[0]	=	new Option();
	}
	
	function ClassLevel1_onchange()
	{
		getdoc();
		FillClassLevel2(g_ClassLevel2, g_ClassLevel1.value);
	}
	
	function InitClassLevelList(ClassLevel1, ClassLevel2)
	{
		g_ClassLevel1=ClassLevel1;
		g_ClassLevel2=ClassLevel2;
	
		g_ClassLevel1.onchange = Function("ClassLevel1_onchange();");
		FillClassLevel1(g_ClassLevel1);
	
		var height = (g_ClassLevel1.options.length * 12 + (!(window.attachEvent && !window.opera) ? 60 : 40)) + 'px';
		g_ClassLevel1.style.height=height;
		g_ClassLevel2.style.height=height;
		ClassLevel1_onchange();
	}
	
	InitClassLevelList(document.ask.ClassLevel1, document.ask.ClassLevel2);
</SCRIPT>
</body>
</html>